#pragma once
//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
 
// class implements virtual Pkt handlers for ease of coding
// forward declare
class VxSktBase;
class VxPktHdr;
class VxBaseSktInfo;

class VxPktHandler
{
public:
	//=== constructor ===//
	VxPktHandler();
	//=== destructor ===//
	virtual ~VxPktHandler();

	//! override this to handle status messages
	virtual void PktStatusMsg( const char * pMsg, ... );
	//! override this to handle error messages
	virtual void PktErrorMsg( const char * pMsg, ... );

	//! give apps chance to override and place callers user data in their own structure
	virtual long SktSetUserData		( VxSktBase * poSkt, void * pvUserData );
	//! give apps chance to override and return callers user data from within their own structure
	virtual long SktGetUserData		( VxSktBase * poSkt, void ** pvRetUserData );


	//=== packet handler methods ===//
	//! Handle Incoming packet.. use function jump table for speed
	virtual long VxHandlePkt		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	//! override this function with your own send packet
	//! NOTE: packet length must be a multiple of 16 bytes ( for block encryption )
	virtual long VxSendPkt			( VxSktBase * poSkt, VxPktHdr * poPktHdr, BOOL bDisconnect = FALSE );
	//! override this function for your own connect to 
	virtual long VxConnectTo		( VxNetIdentBase * poIdent, void * pvUserData, VxSktBase ** ppoRetSkt ){return 0;}
	//! override this function to close socket connection
	virtual long VxCloseConnection	( VxSktBase * poSkt );

	//! override this function to handle packets for which there was no packet handler
	virtual long OnUnhandledPkt		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	//! override this function to handle packets which had a bad packet number or length etc
	virtual long OnInvalidPkt		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );

	//=== file tx/rx functions ===//
	//! override this function to be notified when a file is received
	virtual long OnFileRecieved		( VxSktBase * poSkt, void * pvUserData, const char * pFileName );
	//! override this function to be notified when a file is sent
	virtual long OnFileSent			( VxSktBase * poSkt, void * pvUserData, const char * pFileName );

	//=== helper file tx/rx methods ===//
	//! que a file to be sent
	virtual long QueFileToSend		(	VxSktBase *		poSkt, 
										void *			pvUserData, 
										const char *	pLclFileName, 
										const char *	pRmtFileName, 
										BOOL			bBeginSendingFiles = false );
	//! begin sending qued files
	virtual long BeginFileSend		( VxSktBase * poSkt, void * pvUserData );
	//! start process of receiving a file
	virtual	long BeginFileRecieve	(  VxSktBase * poSkt, void * pvUserData, PktCmd1ArgReq * poPkt );

	//! send next part of file.. assumes user data derived from VxSktInfoBase
	virtual long TxNextFileChunk	( VxSktBase * poSkt, VxBaseSktInfo * poSktInfo, PktFileChunkAck * poPktHdr );
	//! receive next part of file.. assumes user data derived from VxSktInfoBase
	virtual long RxFileChunk		( VxSktBase * poSkt, VxBaseSktInfo * poSktInfo, PktFileChunk * poPkt );
	//! send final sent file packet and close file
	virtual long FinishFileRecieve	( VxSktBase * poSkt, VxBaseSktInfo * poSktInfo, PktFileSendComplete * poPkt  );

	//=== error functions ===//
	//! Send error message
	virtual long SendError(	VxSktBase *		poSkt,		// socket
							int				iPktType,	// type of packet
							unsigned short	u16Cmd,		// packet command
							long			rc,			// error code
							const char *	pMsg, ...);	// error message



	//=== packet handlers for game distribution and administration ====//
	virtual long OnPktKeyReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktKeyReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileChunk		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileChunkAck	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmdBinReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmdBinReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd1ArgReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd1ArgReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd2ArgReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd2ArgReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd3ArgReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCmd3ArgReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileSendComplete( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileSendCompleteAck( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileGetComplete( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileGetCompleteAck( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvailDrivesReq( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvailDrivesReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileListReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFileListReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktImAliveReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktImAliveReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );

	virtual long OnPktChallengeReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktChallengeReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktSessionReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktSessionReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );

	virtual long OnPktLogEntry		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktDebug			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktUpdate		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin29		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin30		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin31		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin32		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin33		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin34		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin35		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin36		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin37		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin38		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin39		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin40		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin41		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin42		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin43		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin44		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin45		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin46		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin47		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin48		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin49		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );

	//=== game engine packets ===//
	// these packets start at packet type 50
	virtual long OnPktAddToContainer( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAdmin			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAnim			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAttackReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAttackReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarCreateReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarCreateReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarDeleteReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarDeleteReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarPlayReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarPlayReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarCheckNameReq( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarCheckNameReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarExitReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAvatarExitReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktEntPosReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktEntPosReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktEntMoveReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktEntMoveReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktBuy			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktCharInfo		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktClick			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktContainerContent( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktDeleteObj		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktDisconnect	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktDragging		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktDrawContainer	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktEffect		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktFightOccurring( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktItemDrop		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktItemPickup	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktItemState		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktLight			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktLoginReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktLoginReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktMobileAttr	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktPlayerStatReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktPlayerStatReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktPunish		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktRename		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktSound			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktStatWnd		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktTalk			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktTargeting		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktTime			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktTrade			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktUpdateChar	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktWarn			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktWeather		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktWebBrowse		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktWornItem		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktPetList		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktGameAcctsReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktGameAcctsReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktEnterGameReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktEnterGameReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktSrvAnnounceReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktSrvAnnounceReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAcctCreateReq			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktAcctCreateReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktGameLoginChallengeReq	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );
	virtual long OnPktGameLoginChallengeReply( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent );

	virtual long OnPktCreatureReq			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //109
	virtual long OnPktCreatureReply			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //110
	virtual long OnPktCreatureStatusReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //111
	virtual long OnPktCreatureStatusReply	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //112
	virtual long OnPktItemReq				( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //113
	virtual long OnPktItemReply				( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //114
	virtual long OnPktItemStatusReq			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //115
	virtual long OnPktItemStatusReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //116
	virtual long OnPktPlayerReq				( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //117
	virtual long OnPktPlayerReply			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //118
	virtual long OnPktPlayerStatusReq		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //119
	virtual long OnPktPlayerStatusReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //120
	virtual long OnPktPlaceableReq			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //121
	virtual long OnPktPlaceableReply		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //122

	virtual long OnPktPortalReq				( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //123
	virtual long OnPktPortalReply			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //124
	virtual long OnPktTeleportReq			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //125
	virtual long OnPktTeleportReply			( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); //126

	virtual long OnPktGEngine127	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine128	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine129	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine130	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine131	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine132	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine133	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine134	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine135	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine136	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine137	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine138	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine139	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine140	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine141	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine142	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine143	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine144	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine145	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine146	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine147	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine148	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGEngine149	( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 

	//=== user defined game engine packets ===//
	//! these packets start at packet type 150
	//! individual games should start their packet types/handlers here
	//! so that when new versions of the game engine come out it does not
	//! have conflicts with the various existing games
	virtual long OnPktGUser150		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); // packet type 150.. start of user defined packets
	virtual long OnPktGUser151		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser152		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser153		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser154		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser155		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser156		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser157		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser158		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser159		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser160		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser161		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser162		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser163		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser164		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser165		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser166		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser167		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser168		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser169		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser170		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser171		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser172		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser173		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser174		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser175		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser176		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser177		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser178		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser179		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser180		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser181		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser182		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser183		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser184		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser185		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser186		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser187		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser188		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser189		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser190		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser191		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser192		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser193		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser194		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser195		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser196		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser197		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser198		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser199		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser200		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser201		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser202		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser203		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser204		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser205		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser206		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser207		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser208		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser209		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser210		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser211		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser212		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser213		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser214		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser215		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser216		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser217		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser218		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser219		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser220		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser221		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser222		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser223		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser224		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser225		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser226		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser227		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser228		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser229		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser230		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser231		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser232		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser233		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser234		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser235		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser236		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser237		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser238		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser239		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser240		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser241		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser242		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser243		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser244		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser245		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser246		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser247		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser248		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	virtual long OnPktGUser249		( VxSktBase * poSkt, VxPktHdr * poPktHdr, VxNetIdent * poIdent ); 
	//NOTE: packet type 250 and greater not allowed by rogue connections
	
	typedef long (VxPktHandler::*VX_BASE_PKT_FUNCTION)( VxSktBase *, VxPktHdr *, VxNetIdent * );  
private:
	//=== vars ====//
	VX_BASE_PKT_FUNCTION m_aBasePktFuncTable[ MAX_TOTAL_PKT_TYPE + 1 ];
};